import os
import unittest

from HTMLTestRunner import HTMLTestRunner

from SmallShop.TestObject.email1 import send_report


if __name__ == '__main__':

    report =unittest.defaultTestLoader.discover(start_dir=os.getcwd()+"\\TestObject",pattern="*.py")

    ar = open(os.getcwd()+"\\report\\Activity.html","wb")

    r = HTMLTestRunner.HTMLTestRunner(stream=ar,
                                      title="登陆测试报告",
                                      description="测试报告如下",
                                      verbosity=2)

    if r.run(report):

        send_report()

    ar.close()